<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<form id="qForm" action="tips/add" method="post">
	<ul class="all_list">
		<li><span class="all_title">显示日期：</span> <span><input readonly="readonly"
				type="text" class="ui_input " id="displayDateFrom"
				name="displayDateFrom" value='<fmt:formatDate value="${displayDateFrom}" pattern="yyyy-MM-dd" />'>
				-
				<input readonly="readonly"
				type="text" class="ui_input " id="displayDateTo"
				name="displayDateTo" value='<fmt:formatDate value="${displayDateTo}" pattern="yyyy-MM-dd" />'>
				</span>
		<li><span class="all_title">		
				显示时间：</span> <span><input type="text" class="ui_input " 
				readonly="readonly" id="displayTime" value="${displayTime }"
				name="displayTime"> (秒) </span>
		</li>
		<li><span class="all_title">
				显示次数：</span>  <span> <input type="text" value="${displayCount }" readonly="readonly"
				class="ui_input " id="displayCount" name="displayCount"> </span></li>
		<li><span class="all_title">接收人：</span> <span><input style="width:400px" readonly="readonly"
				type="text" class="ui_input " id="roleListName" name="roleListName" value="${roleList }">
		</span></li>
		<li class="m-t10"><span class="all_title">显示内容：</span> <span><textarea style="width:400px;height:300px" readonly="readonly"
					class="ui_input " id="content" name="content">${content }</textarea>
		</span></li>
		<li><span class="all_title"></span><span> <input
				type="button" id="return" value="返回修改"
				class="btn_blue m-r15 "> 
				<input type="button" id="recheck" value="刷权限卡" class="btn_card_log m-r15 submitBtn" />
				<input type="hidden" id="roleListId" value="${roleListId }" name="roleListId">
				<input type="hidden" id="cardId" name="cardId">
				<input type="hidden" id="code" name="code">
		</span></li>
	</ul>
</form>
<script>
	$(function(){
		$("#return").click(function(){
			myDialog.close();	
		});
		$("#recheck").click(function(){
			
			$("#read_card").val("读卡中..."); 
			var cardMsg = read_card_to_com("PERMIS_CARD");
			if (cardMsg == "CARD_ERROR") {                                   //判断返回值
		         $("#recheck").val("错误/重读");                           //根据读卡器返回值修改读卡按钮状态
		     } else if (cardMsg == "READ_FAIL") {                           
		        $("#recheck").val("失败/重读");    
			} else {
				 $("#recheck").val("成功/重读");
				$('#cardId').val(cardMsg);
				$('#code').val("bycustom:credit");
				$("#qForm").ajaxSubmit(function(data){
					if(data.success==='succeed'){
						myDialog.close();
						to_page('/tips/view/page');
						
					}else{
						art.dialog({icon: data.success,content: data.message,lock:true});
					}
				});
			}
		});
	});
</script>